package main
import (
	"./ndnKeyChain"
	"fmt"
)

func main(){
	//jsonstr := " { \"Command\" : \"Destroy\", \"Prefix\" : \"/hello\", \"Pubkey\" : \"xxxx\", \"Sig\" : \"F0gwRgIhAPqAZfUJfKTnQCZfbNxUpcdnbwDA7iq1/WYld9lyEPLHAiEA3yWmSug7\n/EFMfRV9ZfuyIsiB1n7uaS1BLaRNowrk+6Q=\n\", \"Timestamp\" : \"1575539347\", \"Type\" : \"user-act\" }"
	//certStr := "Bv0CGQcnCAVoZWxsbwgDS0VZCAhoXtN51kOeDQgEc2VsZggJ/QAAAW7VMpTqFAkY\nAQIZBAA27oAV/QFPMIIBSzCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIh\nAP////8AAAABAAAAAAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAA\nAAAAAAAAAAAA///////////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7\nzjw+J9JgSwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEEaxfR8uEsQkf4vOblY6RA\n8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R\n9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABN7L57d4\nhimOU/Xrp0/1MxdkENEg3DG8GQRV8gNVSbhI+sYx3g0gXF8j/pS2mGRAnBqSEmCw\nVCzFmXvS/xYYasUWRxsBAxwYBxYIBWhlbGxvCANLRVkICGhe03nWQ54N/QD9Jv0A\n/g8xOTcwMDEwMVQwMDAwMDD9AP8PMjAzOTExMzBUMDgzNDUyF0cwRQIgaV2D5G1x\nUTxaqaENRRFizlko7xYpxu7fZCXf9laiFUQCIQD0oD+2+1BNxXHYXuY3+2OVQqC+\npiI0g1k2nnXExYkFWA=="
	//certfromphone := "Bv0CqwcnCAU1NTU1NQgDS0VZCAgm4PfKp1IrPQgEc2VsZggJ/QAAAW8SdpYUFAkYAQIZBAA27oAV/QEmMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzbN3Y9xsiFoUYb2mzamhMiiuR/cFYcmok7w2ttpRTbZ26ayXYDUF5LwYFOwB7ab5fDylYAq8tWPrkI/0Bv4iWMUXS9AthKHNGy7AcFd5JIROb/d1PGsOQnyJy53lVzNC85CVytQA5OLQRBtJZYUajHupc9kvWRMnXSwNZ+rDJ441OFPMvCpB2X9OPK6yug3AEXhPsRQOf2XrvKYmuEqoQlaiT+BtmVhkkPjc7/9vsq4kKB5BaDoU2Iqz406+p6Gs1rKHVskPPVrfKN7fRrn6Prz8C5u696Z4FFFcqead4z1q2XIoirNFLODCD5F//5lAe9/ZF5V/spvjzve/7rj5UQIDAQABFkcbAQEcGAcWCAU1NTU1NQgDS0VZCAgm4PfKp1IrPf0A/Sb9AP4PMjAxOTEyMTdUMDYwNjAw/QD/DzIwMzkxMjEyVDA2MDU1ORf9AQCkw2gGGWmAhvtLm4faK9HE/7zBQ+0VOFajknHnzZD4mCZauc8zEO19r+8OTitmVASfUow6Cz6cUMxd6l2JOc8ZmhH0ucPD8a9liN5AcUj7CfV+likJcYBln7Ita5B4bODVMSb5c9lr9He4Nz3LdAbTycUwjFYdWfjK+TC9AwLvkOV09G+TFmFtHMWQvNeHEDXtxYstlSbt1T8uUbsQ08rK9ynwh2oAUjXy7bEkjoZV/1iNhpWH7gjodxo/uOgG+j2y8XB1qn8AbRl9EVPucdefLPuk9vGQ3uPAjiGRfiftob9RHs96U+RkdcyY86f5dpnpNMEoGk4QisP8Ga41IKw0"
	certStr := "Bv0CMwc0CAN3Z2gICGlkZW50aXR5CAMwMDIIA0tFWQgIQPEto46TzYYIBHNlbGYI"
	//ndnKeyChain.Output()
	//ret,err1 := ndnKeyChain.VerifySignWithCert(jsonstr,certStr)
	//signRet,err2 := ndnKeyChain.SignCert(certfromphone) ;
	signRet,err2 := ndnKeyChain.SignCert(certStr) ;
	//fmt.Println("verify result = ", ret)
	//fmt.Println("verify err = ", err1)
	fmt.Println("sign result = ", signRet)
	fmt.Println("sign err = ", err2)
}
